home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / c / AmiVoGL_MDEV.lha / hershey / src / fhtext.c < prev    next >
C/C++ Source or Header  |  1994-04-12  |  4KB  |  427 lines

  1. /* fhtext.c: */
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include "hershey.h"
  5.  
  6. /* --------------------------------------------------------------------- */
  7.  
  8. /*
  9.  * hsetpath_
  10.  */
  11. void hsetpath_(
  12.   char *fpath,
  13.   int *len1,
  14.   int len2)
  15. {
  16.     char    buf[BUFSIZ];
  17.  
  18.     strncpy(buf, fpath, len2);
  19.     buf[*len1] = 0;
  20.  
  21.     hsetpath(buf);
  22. }
  23.  
  24. /*
  25.  * hsetpa_
  26.  */
  27. void hsetpa_(
  28.   char *fpath,
  29.   int *len1,
  30.   int len2)
  31. {
  32.     char    buf[BUFSIZ];
  33.  
  34.     strncpy(buf, fpath, len2);
  35.     buf[*len1] = 0;
  36.  
  37.     hsetpath(buf);
  38. }
  39.  
  40. /*
  41.  * hfont_
  42.  */
  43. void hfont_(
  44.   char *fontfile,
  45.   int *len1,
  46.   int len2)
  47. {
  48.     char    buf[BUFSIZ];
  49.  
  50.     strncpy(buf, fontfile, len2);
  51.     buf[*len1] = 0;
  52.  
  53.     hfont(buf);
  54. }
  55.  
  56. /*
  57.  * htextsize_
  58.  */
  59. void htextsize_(
  60.   float *width,
  61.   float *height)
  62. {
  63.     htextsize(*width, *height);
  64. }
  65.  
  66. /*
  67.  * htexts_
  68.  */
  69. void htexts_(
  70.   float *width,
  71.   float *height)
  72. {
  73.     htextsize(*width, *height);
  74. }
  75.  
  76. /*
  77.  * hboxtext_
  78.  */
  79. int hboxtext_(
  80.   float *x,
  81.   float *y,
  82.   float *l,
  83.   float *h,
  84.   char *s,
  85.   int *length,
  86.   int len)
  87. {
  88.     char        buf[BUFSIZ];
  89.     register char   *p;
  90.  
  91.     strncpy(buf, s, len);
  92.     buf[*length] = 0;
  93.  
  94.     hboxtext(*x, *y, *l, *h, buf);
  95. }
  96.  
  97. /*
  98.  * hboxte_    (same as hboxtext_)
  99.  */
  100. int hboxte_(
  101.   float *x,
  102.   float *y,
  103.   float *l,
  104.   float *h,
  105.   char *s,
  106.   int *length,
  107.   int len)
  108. {
  109.     char        buf[BUFSIZ];
  110.     register char   *p;
  111.  
  112.     strncpy(buf, s, len);
  113.     buf[*length] = 0;
  114.  
  115.     hboxtext(*x, *y, *l, *h, buf);
  116. }
  117.  
  118. /*
  119.  * hboxfit_
  120.  */
  121. int hboxfit_(
  122.   float *l,
  123.   float *h,
  124.   int *nchars)
  125. {
  126.     hboxfit(*l, *h, *nchars);
  127. }
  128.  
  129. /*
  130.  * hboxfi_
  131.  */
  132. int hboxfi_(
  133.   float *l,
  134.   float *h,
  135.   int *nchars)
  136. {
  137.     hboxfit(*l, *h, *nchars);
  138. }
  139.  
  140. /*
  141.  * htextang_
  142.  */
  143. void htextang_(float *ang)
  144. {
  145.     htextang(*ang);
  146. }
  147.  
  148. /*
  149.  * htexta_
  150.  */
  151. void htexta_(float *ang)
  152. {
  153.     htextang(*ang);
  154. }
  155.  
  156. /*
  157.  * hdrawchar_
  158.  */
  159. int hdrawchar_(char *s)
  160. {
  161.     hdrawchar(*s);
  162. }
  163.  
  164. /*
  165.  * hdrawc_
  166.  */
  167. int hdrawc_(char *s)
  168. {
  169.     hdrawchar(*s);
  170. }
  171.  
  172. /*
  173.  * hcharstr_
  174.  */
  175. int hcharstr_(
  176.   char *s,
  177.   int *length,
  178.   int len)
  179. {
  180.         char            buf[BUFSIZ];
  181.     register char   *p;
  182.  
  183.     strncpy(buf, s, len);
  184.     buf[*length] = 0;
  185.     hcharstr(buf);
  186. }
  187.  
  188. /*
  189.  * hchars_
  190.  */
  191. int hchars_(
  192.   char *s,
  193.   int *length,
  194.   int len)
  195. {
  196.         char            buf[BUFSIZ];
  197.     register char   *p;
  198.  
  199.     strncpy(buf, s, len);
  200.     buf[*length] = 0;
  201.     hcharstr(buf);
  202. }
  203.  
  204. /*
  205.  * hgetfontheight_
  206.  */
  207. float hgetfontheight_(void)
  208. {
  209.     return(hgetfontheight());
  210. }
  211.  
  212. /*
  213.  * hgetfh_
  214.  */
  215. float hgetfh_(void)
  216. {
  217.     return(hgetfontheight());
  218. }
  219.  
  220. /*
  221.  * hgetfontwidth_
  222.  */
  223. float hgetfontwidth_(void)
  224. {
  225.     return(hgetfontwidth());
  226. }
  227.  
  228. /*
  229.  * hgetfw_
  230.  */
  231. float hgetfw_(void)
  232. {
  233.     return(hgetfontwidth());
  234. }
  235.  
  236. /*
  237.  * hgetdecender_
  238.  */
  239. float hgetdecender_(void)
  240. {
  241.     return(hgetdecender());
  242. }
  243.  
  244. /*
  245.  * hgetde_
  246.  */
  247. float hgetde_(void)
  248. {
  249.     return(hgetdecender());
  250. }
  251.  
  252. /*
  253.  * hgetascender_
  254.  */
  255. float hgetascender_(void)
  256. {
  257.     return(hgetascender());
  258. }
  259.  
  260. /*
  261.  * hgetas_
  262.  */
  263. float hgetas_(void)
  264. {
  265.     return(hgetascender());
  266. }
  267.  
  268. /*
  269.  * hgetfontsize_
  270.  */
  271. void hgetfontsize_(
  272.   float *cw,
  273.   float *ch)
  274. {
  275.     hgetfontsize(cw, ch);
  276. }
  277.  
  278. /*
  279.  * hgetfs_
  280.  */
  281. void hgetfs_(
  282.   float *cw,
  283.   float *ch)
  284. {
  285.     hgetfontsize(cw, ch);
  286. }
  287.  
  288. /*
  289.  * hgetcharsize_
  290.  */
  291. void hgetcharsize_(
  292.   char *c,
  293.   float *cw,
  294.   float *ch)
  295. {
  296.     hgetcharsize(*c, cw, ch);
  297. }
  298.  
  299. /*
  300.  * hgetch_
  301.  */
  302. void hgetch_(
  303.   char *c,
  304.   float *cw,
  305.   float *ch)
  306. {
  307.     hgetcharsize(*c, cw, ch);
  308. }
  309.  
  310. /*
  311.  * hfixedwidth
  312.  */
  313. void hfixedwidth_(int *i)
  314. {
  315.     hfixedwidth(*i);
  316. }
  317.  
  318. /*
  319.  * hfixed_
  320.  */
  321. void hfixed_(int *i)
  322. {
  323.     hfixedwidth(*i);
  324. }
  325.  
  326. /*
  327.  * hcentertext
  328.  */
  329. void hcentertext_(int *i)
  330. {
  331.     hcentertext(*i);
  332. }
  333.  
  334. /*
  335.  * hcente_
  336.  */
  337. void hcente_(int *i)
  338. {
  339.     hcentertext(*i);
  340. }
  341.  
  342. /*
  343.  * hrightjustify_
  344.  */
  345. void hrightjustify_(int *i)
  346. {
  347.     hrightjustify(*i);
  348. }
  349.  
  350. /*
  351.  * hright_
  352.  */
  353. void hright_(int *i)
  354. {
  355.     hrightjustify(*i);
  356. }
  357.  
  358. /*
  359.  * hleftjustify_
  360.  */
  361. void hleftjustify_(int *i)
  362. {
  363.     hleftjustify(*i);
  364. }
  365.  
  366. /*
  367.  * hleftj_
  368.  */
  369. void hleftj_(int *i)
  370. {
  371.     hleftjustify(*i);
  372. }
  373.  
  374. /*
  375.  * hnumchars_
  376.  */
  377. int hnumchars_(void)
  378. {
  379.     return(hnumchars());
  380. }
  381.  
  382. /*
  383.  * hnumch_
  384.  */
  385. int hnumch_(void)
  386. {
  387.     return(hnumchars());
  388. }
  389.  
  390. /*
  391.  * hstrlength_
  392.  */
  393. float hstrlength_(
  394.   char *str,
  395.   int *len0,
  396.   int len1)
  397. {
  398.         char            buf[BUFSIZ];
  399.     register char   *p;
  400.  
  401.     strncpy(buf, str, len1);
  402.     buf[*len0] = 0;
  403.  
  404.     return(hstrlength(buf));
  405. }
  406.  
  407. /*
  408.  * hstrle_
  409.  */
  410. float hstrle_(
  411.   char *str,
  412.   int len)
  413. {
  414.         char            buf[BUFSIZ];
  415.     register char   *p;
  416.  
  417.     strncpy(buf, str, len);
  418.     buf[len] = 0;
  419.  
  420.     for (p = &buf[len - 1]; *p == ' '; p--)
  421.         ;
  422.  
  423.     *++p = 0;
  424.  
  425.     return(hstrlength(buf));
  426. }
  427.